<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
 
<title>缺陷管理系统</title>
<meta name="keywords" content="缺陷管理系统">
<meta name="description" content="缺陷管理系统">
<base href="${pageContext.request.contextPath}/" />
<script src="js/jquery.1.11.1.js"></script>

<link href="css/bootstrap.min.css-v=3.3.5.css" rel="stylesheet">
<link href="css/style.min.css-v=4.0.0.css" rel="stylesheet">
<script src="layer/layer.js"></script>
   <script src="js/login.js"></script>
</head>
<body>
	<form enctype="multipart/form-data" method="post"
		action="updateuser/picture" name="addForm"
		onsubmit="return tosure()" class="login-form" id="loginForm">

		<div align="center">
			<br> <br> <img align="center" id="imgPre" src=""
				width="300px" height="215px" alt="点击上传用户头像"
				onclick="F_Open_dialog()" style="display: block;" />

			<div class="form-group">
				<input type="file" name="file" id="imgOne" required="required"
					style="display: none" onchange="preImg(this.id,'imgPre');"
					class="form-control" />
			</div>


			<button type="submit" style="width: 200px;"  onclick="SendForm()"
				class="btn btn-primary btn-block margin-top-30">点击提交</button>
		</div>
		<br>
		<br>
	</form>
<script type="text/javascript">
		function getFileUrl(sourceId) { 
		var url; 
		if (navigator.userAgent.indexOf("MSIE")>=1) { // IE 
			url = document.getElementById(sourceId).value; 
			} else if(navigator.userAgent.indexOf("Firefox")>0) { // Firefox 
			url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0)); 
			} else if(navigator.userAgent.indexOf("Chrome")>0) { // Chrome 
			url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0)); 
			} 
		return url; 
		} 
	
/** 
* 将本地图片 显示到浏览器上 
*/ 
		function preImg(sourceId, targetId) { 
		var url = getFileUrl(sourceId); 
		var imgPre = document.getElementById(targetId); 
		imgPre.src = url; 
		} 

        function F_Open_dialog() 
       { 
            document.getElementById("imgOne").click(); 
       } 
        function SendForm () 
         {
        	  layer.msg('玩命提示中');
                   document.addForm.submit();
                 
        
         }
        </script>
        	
</body>

</html>